package com.xuecheng.manage_cms.controller;

import com.xuecheng.api.system.SysDicthinaryControllerApi;
import com.xuecheng.framework.domain.system.SysDictionary;
import com.xuecheng.manage_cms.service.SysDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhaoxiang
 * @version 1.0
 * @Date 2019/10/31 11:22
 */
@RestController
@RequestMapping("/sys/dictionary")
public class SysDictionaryController implements SysDicthinaryControllerApi {

    @Autowired
    private SysDictionaryService sysDictionaryService;

    /**
     * 字典查询课程等级信息
     * @param dType
     * @return
     */
    @Override
    @RequestMapping("/get/{type}")
    public SysDictionary getByType(@PathVariable("type") String dType) {
        return sysDictionaryService.findDictionaryByDtype(dType);
    }
}
